package com.netjava.service.impl;

import java.util.List;

import com.netjava.dao.INoticeDAO;
import com.netjava.pojo.Notice;
import com.netjava.pojo.User;
import com.netjava.service.INoticeService;
/**
 * 用户关注的商品的业务的实施类。
 * @author nana
 *
 */
public class NoticeService implements INoticeService{

	private INoticeDAO noticeDao;
	public void addNotice(Notice notice) {
		noticeDao.save(notice);
	}

	public void delete(Notice notice) {
		noticeDao.delete(notice);
	}

	public Notice getNoticeById(Integer id) {
		return noticeDao.findById(id);
	}

	public INoticeDAO getNoticeDao() {
		return noticeDao;
	}

	public void setNoticeDao(INoticeDAO noticeDao) {
		this.noticeDao = noticeDao;
	}
	 public List getByUserId(User user){
		 return noticeDao.findByUserId(user);
	 }

}
